var ClubChangeNameWindow = Window.extend({
    _ccsFileName: res.ClubChangeNameWindow_json,
    initWindow: function (clubId) {
        this._clubId = clubId;
        this._nodeList['input'].setTextVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_CENTER);
    },

    _initClickListeners: function () {
        this._clickListeners = {
            'btn_ok': '_clickOk',
        };
    },

    _clickOk: function () {
        this._nodeList['input'].didNotSelectSelf();
        var input = this._nodeList['input'].getString();

        var tip = '';
        var str = input;
        if (str == null || str == undefined || str == '') {
            tip = '亲友圈名称为空';
        }
        if (tip == '' && (str.length < 2 || str.length > 17)) {
            tip = '群名称长度在2-16字符之间';
        }
        if (tip == '') {
            network.send(2103, {cmd: ClubMsgCode.ModifyClub, club_id: this._clubId, name: str});
            this.close();
        } else {
            showAlert(tip);
        }
    },
});